#include <func.h>
void sigfunc(int signum)
{
    printf("SIGINT is coming now\n");
}
int main(int argc,char *argv[])
{
    sigset_t mask;
    sigset_t pend;
    sigemptyset(&mask);
    sigemptyset(&pend);
    sigaddset(&mask,SIGINT);
    int ret=sigprocmask(SIG_BLOCK,&mask,NULL);
    ERROR_CHECK(ret,-1,"sigprocmask");
    sleep(5);
    if(sigismember(&mask,SIGINT))
    {
        printf("---SIGINT is pending now!\n");
    }
    ret=sigprocmask(SIG_UNBLOCK,&mask,NULL);
    ERROR_CHECK(ret,-1,"sigprocmask");
    sigpending(&pend);
    signal(SIGINT,sigfunc);
    while(1)
        sleep(1);
    return 0;
}

